TRIANGULUM UNIFIED API FILE

*** POSTGRESQL ***

This is an API file that provides stored procedures
for POSTGRESQL.  Similar files exist for
all other supported platforms.

These files provide a unified API for Triangulum 
programmers on all supported platforms.  This makes
two things easier:

  * Triangulum itself is easier for us to program
  * Programmers can create cross-platform sprocs,
    triggers and views that will be guaranteed
    cross-platform

This header is ignored by the builder, there is a 
line below that delimits header from body.

The individual functions are separated by a line that
contains the text "-- FUNCTION --"

The first line after "--FUNCTION--" is the function
name, this is required so these files can be scanned
and lists of supported functions can be built.

Everything after the first line is the function body.

Blank lines before the title and after the body 
are ignored. 

Sometimes we need to provide a function on one platform
that exists natively on another.  For completeness, we
list *all functions* on *all platforms*.  If a function
exists on a platform and does not need to be provided
we put *NATIVE* for the function body.

EVERTYHING ABOVE THE NEXT LINE IS IGNORED BY THE BUILDER
THE FIRST TWO LINES AFTER THE DELIMITER ARE IGNORED,
THIS IS FOR READABILITY
----- FILE BEGINS BELOW THIS LINE -----

triIdentity
CREATE OR REPLACE FUNCTION triIdentity()
RETURNS INT
AS
$BODY$
BEGIN 
    RETURN lastval();
END
$BODY$
LANGUAGE plpgsql;

-- FUNCTION --


RTRIM
*NATIVE*

-- FUNCTION --

LTRIM
*NATIVE*

-- FUNCTION --

TRIM
*NATIVE*


-- FUNCTION --

LPAD
*NATIVE*

-- FUNCTION --

RPAD
*NATIVE*

